import { GameDefConfig } from "../../../resource/GameDefConfig";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { Vector } from "../../../../../__AS3__/vec/Vector";
type int = number;
//class IntimateHeartShaped
    
    export  class IntimateHeartShaped /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            if (!IntimateHeartShaped.vcLevelIntimate) 
            {
                IntimateHeartShaped.vcLevelIntimate = GameDefConfig.instance.getIntimateList();
            }
            this.mouseEnabled = false;
            this.mouseChildren = false;
            this._bmp = GlobalClass.getBitmap(ImagesConst.HeartShapedGray);
            this.addChild(this._bmp);
            return;
        }

        public set intimate(arg1: int)
        {
            var loc6=0;
            var loc7=0;
            var loc1=GlobalClass.getBitmapData(ImagesConst.HeartShapedGray);
            var loc2=GlobalClass.getBitmapData(ImagesConst.HeartShapedLight);
            this._intimate = arg1;
            var loc3=0;
            var loc4=(IntimateHeartShaped.endPos - IntimateHeartShaped.startPos) / vcLevelIntimate.length;
            this._bmpd = loc1.clone();
            var loc5=0;
            while (loc5 < IntimateHeartShaped.vcLevelIntimate.length) 
            {
                if (this._intimate < IntimateHeartShaped.vcLevelIntimate[loc5]) 
                {
                    loc6 = loc5 != 0 ? IntimateHeartShaped.vcLevelIntimate[(loc5 - 1)] : 0;
                    loc7 = IntimateHeartShaped.vcLevelIntimate[loc5];
                    loc3 = loc3 + (this._intimate - loc6) / (loc7 - loc6) * loc4;
                    break;
                }
                else 
                {
                    loc3 = loc3 + loc4;
                }
                ++loc5;
            }
            this._bmpd.draw(loc2, null, null, null, new Object /* flash.geom.Rectangle */(IntimateHeartShaped.startPos, 0, loc3, loc1.height));
            this._bmp.bitmapData = this._bmpd;
            return;
        }

        /* internal */ static /* const */startPos: number=0;

        /* internal */ static /* const */endPos: number=118;

        /* internal */ /* var */_intimate: int;

        /* internal */ /* var */_bmp: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_bmpd: Object /* flash.display.BitmapData */;

        public static /* var */vcLevelIntimate: Vector.<int>;
    }
